<template>
    <div class="card-box">
        <el-col :md="24" class="text-right mb20">
          <router-link to="/carrier_interface_sets/new">
            <el-button type="primary">新增</el-button>
          </router-link>
        </el-col>
        <el-table :data="tableData" stripe border style="width: 100%">
            <el-table-column prop="name" label="接口套装名称">
            <template slot-scope="scope">
                <span class="link" @click="getDetail(scope.row)">{{ scope.row.name}}</span>
            </template>
            </el-table-column>
            <el-table-column prop="api_num" label="接口总数" width="200">
            </el-table-column>
            <el-table-column prop="cha_type" label="查询类" width="200">
            </el-table-column>
            <el-table-column prop="cao_type" label="操作类" width="200">
            </el-table-column>
            <el-table-column prop="methods" label="操作" width="200">
            <template slot-scope="scope">
                <el-button size="mini" @click="editSingData(scope.row)">编辑</el-button>
                <el-button size="mini" type="danger" @click="deleteSingData(scope.row)">删除</el-button>
            </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                tableData: [
                    {
                        id: 1,
                        name: '322',
                        api_num: 0,
                        cha_type: 0,
                        cao_type: 0
                    }
                ]
            }
        },
        methods: {
            editSingData() {
                this.$router.push({
                    path: '/carrier_interface_sets/edit'
                })
            },
            getDetail(goods) {
                this.$router.push({
                    path: `/carrier_interface_sets/${goods.id}`
                })
            }
        }
    }
</script>

<style scoped lang="scss">
    .text-right {
        text-align: right;
    }
</style>